package priv.yiyuan.example.design.product.strategy;

/**
 * 会员价格策略
 * <p>
 * 策略模式-具体策略
 */
public class MemberPriceStrategy implements PriceCalculationStrategy {

    /**
     * 会员折扣价
     */
    private double memberDiscount;

    public MemberPriceStrategy(double memberDiscount) {
        this.memberDiscount = memberDiscount;
    }

    @Override
    public double calculatePrice(double originalPrice) {
        System.out.println("使用会员折扣，折扣价格: " + memberDiscount);
        return originalPrice - memberDiscount;
    }
}
